<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
    xmlns:dssp="http://schemas.microsoft.com/xw/2004/10/dssp.html"
    xmlns:sp03="http://www.robot-electronics.co.uk/2006/10/sp03hardware.html" 
    >

  <xsl:import href="/resources/dss/Microsoft.Dss.Runtime.Home.MasterPage.xslt" />

  <xsl:template match="/">
    <xsl:comment>
      <!-- Service Header Info -->
    </xsl:comment>
    <xsl:variable name="title">
      SP03 Hardware Service
    </xsl:variable>
    <xsl:variable name="serviceName">
      SP03 Text to Speech Service
    </xsl:variable>
    <xsl:variable name="description">
      The SP03 module includes an audio amplifier, a 3volt regulator and level conversion to 5volts, a PIC processor to provide easy communication with your host processor and even a small 40mm speaker, along with the WTS701 text-to-speech synthesizer.
    </xsl:variable>

    <xsl:call-template name="MasterPage">
      <xsl:with-param name="serviceName" select="$serviceName" />
      <xsl:with-param name="description" select="$description" />
      <!-- If title is not provided, serviceName will be used instead. -->
      <xsl:with-param name="title">
        <xsl:value-of select="$serviceName" />
        <xsl:if test="$title != ''">
          <xsl:text> - </xsl:text>
          <xsl:value-of select="$title" />
        </xsl:if>
      </xsl:with-param>
      <!-- Possible values for navigation are: 'Open', 'Closed', and 'None'
           'Open' is the default value. -->
      <xsl:with-param name="navigation" select="'Open'" />
      <!-- The contents of head param will be placed just before the </head> tag in html. -->
      <xsl:with-param name="head">
        <link rel="stylesheet" type="text/css" href="/resources/I2CHardware/Devantech.Services.I2C.Hardware.resources.DevantechI2CHardware.Stylesheet.css" />

        <style type="text/css">
          /* Service-specific stylesheet goes here */
        </style>
        <script language="javascript" type="text/javascript">
          <![CDATA[<!--

/* Service-specific script goes here */

dssRuntime.init = function()
{
  // Add page initialization code here.
  // This function is attached to the window.onload event.
  // Do not override window.onload.
}

//-->     ]]>
        </script>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:template>

  <!-- Match service state's document element. -->

	<xsl:template match="/sp03:SP03HardwareState">
				<br clear="all" />
				<div class="hr"></div>
        
          <div class="RightColumn">
					<form method="POST" >
						<fieldset >
							<legend>Set Rate</legend>
              <span class="helpText">The rate of speech (0-7)</span>
								<label for="Rate">Rate:</label>
								<div class="fieldrowright">
									<input type="text" name="Rate" class="Editable">
										<xsl:attribute name="value">
											<xsl:value-of select="sp03:Rate"/>
										</xsl:attribute>
									</input>
								</div>
              <div class="submitButtonsSelected">
                <input type="submit" value="Set Rate" class="OrangeButton" />
              </div>
						</fieldset>
					</form>
					<form method="POST" >
						<fieldset>
							<legend>Set Pitch</legend>
              <span class="helpText">The pitch of speech (0-7)</span>
								<label for="Pitch">Pitch:</label>
               
								<div class="fieldrowright">
									<input type="text" name="Pitch" class="Editable">
										<xsl:attribute name="value">
											<xsl:value-of select="sp03:Pitch"/>
										</xsl:attribute>
									</input>
								</div>

              <div class="submitButtonsSelected" >
                <input type="submit" value="Set Pitch" class="OrangeButton" />
              </div>
						</fieldset>
					</form>
          <form method="POST" >
						<fieldset>
							<legend>Set Volume</legend>
							<span class="helpText">The volume of speech (0-7)</span>
								<label for="Volume">Volume:</label>
               
								<div class="fieldrowright">
									<input type="text" name="Volume" class="Editable">
										<xsl:attribute name="value">
											<xsl:value-of select="sp03:Volume"/>
										</xsl:attribute>
									</input>
							  </div>
              <div class="submitButtonsSelected">
                <input type="submit" value="Set Volume" class="OrangeButton" />
              </div>
						</fieldset>
					</form>
          </div>
					<form method="POST" >
						<fieldset>
							<legend>Say Stored Phrase</legend>
              <span class="helpText">Plays a previously stored phrase. Phrases must be stored using the serial interface, using <a href="http://www.robot-electronics.co.uk/files/sp03.exe">Devantech's SP03.exe application</a>.</span>

								<label for="Phrase">Phrase:</label>
              								<div class="fieldRowRight">
                  <select id="Phrase" name="Phrase">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                    <option value="15">15</option>
                    <option value="16">16</option>
                    <option value="17">17</option>
                    <option value="18">18</option>
                    <option value="19">19</option>
                    <option value="20">20</option>
                    <option value="21">21</option>
                    <option value="22">22</option>
                    <option value="23">23</option>
                    <option value="24">24</option>
                    <option value="25">25</option>
                    <option value="26">26</option>
                    <option value="27">27</option>
                    <option value="28">28</option>
                    <option value="29">29</option>
                    <option value="30">30</option>
                  </select>
							</div>
              <br clear="left" />
              <div class="submitButtonsSelected" >
                <input type="submit" value="SayPhrase" class="OrangeButton" />
              </div>
						</fieldset>
					</form>

					<form method="POST" >
						<fieldset>
							<legend>Say Text</legend>
                <span class="helpText">Raw text to send to be spoken.</span>
							<label for="SpeechText">Speech Text:</label>
							<div class="fieldRowRight">
								<input type="text" name="SpeechText" class="Editable">
									<xsl:attribute name="value">
										<xsl:value-of select="sp03:SpeechText"/>
									</xsl:attribute>
								</input >
						  </div>
                <div class="submitButtonsSelected" >
							<input type="submit" value="SayText" class="OrangeButton" />
              </div>
						</fieldset>
					</form>

     
				<br clear="all" />
				<div class="hr"></div>
        <div class="RightColumn">
          <a class="LinkSmall" href="http://www.robot-electronics.co.uk/htm/Sp03doc.shtml" target="_new">View Devantech Documentation</a>
        </div>
				<span class="smallText">Config at: /store/Devantech.Services.SP03.Hardware.xml</span>
				<br/>
	</xsl:template>
</xsl:stylesheet>
